//
//  Extension.swift
//  微博三天
//
//  Created by jessica on 15/11/15.
//  Copyright © 2015年 jessica. All rights reserved.
//

import UIKit


extension UILabel{
    
    convenience init (title: String,size: CGFloat,color: UIColor,margin: CGFloat = 0) {
        
        self.init()
        
        text = title
        numberOfLines = 0 //换行
        textAlignment = NSTextAlignment.Center
        font = UIFont.systemFontOfSize(size)
        textColor = color
        if margin != 0{
            preferredMaxLayoutWidth =  screenW -  2 * margin
            textAlignment = .Left
            
        }
        //大小
        sizeToFit()
        
    }
   
    
}
